package com.turing.service.impl;

import com.turing.domain.Person;
import com.turing.mapper.PersonMapper;
import com.turing.service.IPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class PersonServiceImpl implements IPersonService {

    @Autowired
    private PersonMapper personMapper;
    @Override
    public List<Person> selectAll() {
        return personMapper.selectList();
    }

    @Override
    public Person selectById(Long id) {
        return personMapper.selectByPrimaryKey(id);
    }

    @Override
    public int insertOne(Person person) {
        return personMapper.insertSelective(person);
    }

    @Override
    public int updateById(Person person) {
        return personMapper.updateByPrimaryKeySelective(person);
    }

    @Override
    public int deleteByIds(Long[] ids) {
        return personMapper.deleteByPrimaryKey(ids);
    }

    @Override
    public List<Person> selectPage(Person person) {
        return personMapper.selectPage(person);
    }
}
